Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to indent/un-indent multiple list items #1642

Merged
merged 4 commits into from
Jul 1, 2022

Conversation

zakishaheen
Copy link
Contributor

@zakishaheen zakishaheen commented Jun 30, 2022

Description

This fixes a whole class of list indentation bugs that are introduced due to "hanging" nodes.

There is still a bug in Slate's hang code for which @davisg123 created this PR.

See changesets.

Before:

CleanShot.2022-06-30.at.17.41.03.mp4

After:

CleanShot.2022-06-30.at.17.39.58.mp4

@changeset-bot
Copy link

changeset-bot bot commented Jun 30, 2022

🦋 Changeset detected

Latest commit: 94cd1a4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@udecode/plate-list Minor
@udecode/plate-headless Minor
@udecode/plate-indent-list Minor
@udecode/plate-serializer-md Minor
@udecode/plate-ui-list Minor
@udecode/plate Minor
@udecode/plate-ui Minor
@udecode/plate-serializer-docx Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Jun 30, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
plate ✅ Ready (Inspect) Visit Preview Jul 1, 2022 at 2:58AM (UTC)

zbeyens
zbeyens previously approved these changes Jun 30, 2022
@zakishaheen
Copy link
Contributor Author

zakishaheen commented Jun 30, 2022

@zbeyens i'm still working on some more tests and if they pass, will make it ready-for review

I am seeing that if you have a list like this:

1. E1
2. E|2
3. E3|

(with focus/anchor as shown by |), and pressing tab, the editor itself loses focus (or in playgrounds, it doesn't do anything). Surprisingly, the following works fine'ish:

1. E1
  1. E|2
  2. E3|
4. E4

This results in the incorrect:

1. E1
  1. E|2
    1. E3|
4. E4

I was expecting it to not change (since we can't double indent on the list)

1. E1
  1. E|2
  1. E3|
4. E4

Here are some other examples:

CleanShot 2022-06-30 at 11 08 34

zbeyens
zbeyens previously approved these changes Jul 1, 2022
Copy link
Member

@zbeyens zbeyens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, great work!

@zbeyens
Copy link
Member

zbeyens commented Jul 1, 2022

@zakishaheen just needs a changeset as mentioned by the comment above

@zakishaheen
Copy link
Contributor Author

Changeset added @zbeyens

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants